import axios from "axios";
import store from "@/store";
import {locals} from "cesium-measure";
export function option(val){
    let server=axios.create({
        baseURL:"http://120.46.72.236:8009",
        //timeout:6000
    });
    //请求拦截
    server.interceptors.request.use(function (config) {
        const t = JSON.parse(localStorage.getItem('memory'))
        if(t&&t.token){
            config.headers.token = t.token
        }
        return config;
    }, function (error) {
        console.log(error)
    });

    // 添加响应拦截器
    server.interceptors.response.use(function (response) {
        return response;
    }, function (error) {
        console.log(error)
    });

    return server(val)
}